﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Mapping.Attributes;
namespace TinyERP.Core.Entity
{
    [NHibernate.Mapping.Attributes.Class(Table = "UserData", NameType=typeof(User), Lazy=false)]
    public class User
    {
        [NHibernate.Mapping.Attributes.Id(0, TypeType = typeof(long), Column = "ID", Name = "ID")]
        [NHibernate.Mapping.Attributes.Generator(1, Class = "native")]
        public virtual long ID { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "UserName")]
        public virtual string UserName { get; set; }


        [NHibernate.Mapping.Attributes.Property(Column = "Password")]
        public virtual string Password { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "FullName")]
        public virtual string FullName { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "Address")]
        public virtual string Address { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "Phone")]
        public virtual string Phone { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "Birthdate")]
        public virtual DateTime? Birthdate { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "Email")]
        public virtual string Email { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "IsSystemAdmin")]
        public virtual bool IsSystemAdmin { get; set; }

        [NHibernate.Mapping.Attributes.ManyToOne(Column = "UserGroupID", Fetch = FetchMode.Join, ClassType=typeof(Group), Lazy = Laziness.False)]
        public virtual Group Group { get; set; }

        [NHibernate.Mapping.Attributes.ManyToOne(Column = "DepartmentID", Fetch = FetchMode.Join, ClassType = typeof(Department), Lazy = Laziness.False)]
        public virtual Department Department { get; set; }
        
    }
}
